home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CMIDI 2.2 / CMIDITimePort.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  2.0 KB  |  57 lines  |  [TEXT/KAHL]

  1. /*
  2.  *——— CMIDITimePort.h ————————————————————————————————————————————————————————
  3.  * Copyright © Paul Ferguson, 1990-1994.  All rights reserved.
  4.  *
  5.  * For use with Symantec C++ 6.0 and the THINK Class Library.
  6.  *
  7.  * Description:
  8.  *    This class defines a MIDI Manager time port object.
  9.  *
  10.  *    Refer to the CMIDI Programmer's Manual for a complete desciption of
  11.  *    this class.
  12.  *————————————————————————————————————————————————————————————————————————————
  13.  */
  14. #pragma once
  15. #include "CMIDIPort.h"
  16.  
  17. #define kNoClient    '    '                // The UnClient
  18.  
  19. class CMIDITimePort : public CMIDIPort
  20. {
  21.  
  22. public:
  23.  
  24.     OSErr            IMIDITimePort(
  25.                         StringPtr    theName,         // Pascal format, 31 char max
  26.                         OSType        thePortID,        // Used when signing into MM
  27.                         Boolean        theVisibleFlag,
  28.                         short        theFormat);        // Initial time format
  29.  
  30.     virtual    OSErr    LoadPatches(ResType theResType, short theResID);
  31.     short            GetSync(void);
  32.     void            SetExternalSync(void);
  33.     void            SetInternalSync(void);
  34.     short            UpdateSync(void);
  35. #ifdef __cplusplus
  36.     long            GetCurTime(void)            { return (itsVersion ? MIDIGetCurTime(itsRefNum) : 0); };
  37.     void            SetCurTime(long theTime)    { if (itsVersion) MIDISetCurTime(itsRefNum, theTime); };
  38.     void            StartTime(void)                { if (itsVersion) MIDIStartTime(itsRefNum); };
  39.     void            StopTime(void)                { if (itsVersion) MIDIStopTime(itsRefNum); };
  40.     long            GetOffsetTime(void)            { return (itsVersion ? MIDIGetOffsetTime(itsRefNum) : 0); };
  41.     void            SetOffsetTime(long theOffset) { if (itsVersion) MIDISetOffsetTime(itsRefNum, theOffset); };
  42.     void            WakeUp(long theBaseTime, long thePeriod, ProcPtr theTimeProc) { if (itsVersion) MIDIWakeUp(itsRefNum, theBaseTime, thePeriod, theTimeProc); };
  43. #else
  44.     long            GetCurTime(void);
  45.     void            SetCurTime(long theTime);
  46.     void            StartTime(void);
  47.     void            StopTime(void);
  48.     long            GetOffsetTime(void);
  49.     void            SetOffsetTime(long theOffset);
  50.     void            WakeUp(long theBaseTime, long thePeriod, ProcPtr theTimeProc);
  51. #endif
  52.     void            SetConnection(ProcPtr theConnectionProc);
  53.     virtual    void    Perform(long * maxSleep);        // Makes this object a CChore
  54. };
  55.  
  56. // end of CMIDITimePort.h
  57.